﻿// OperatorDialog.cpp: 实现文件
//

#include "stdafx.h"
#include "zChecker.h"
#include "OperatorDialog.h"
#include "afxdialogex.h"


// COperatorDialog 对话框

IMPLEMENT_DYNAMIC(COperatorDialog, CDialogEx)

COperatorDialog::COperatorDialog(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_OPERATOR, pParent)
{
	m_pOperator = NULL;
}

COperatorDialog::~COperatorDialog()
{
}

void COperatorDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_MFCPROPERTYGRID1, m_grid);
}


BEGIN_MESSAGE_MAP(COperatorDialog, CDialogEx)
	ON_WM_CREATE()
END_MESSAGE_MAP()


// COperatorDialog 消息处理程序


int COperatorDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialogEx::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  在此添加您专用的创建代码

	return 0;
}


BOOL COperatorDialog::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	m_grid.Init2();
	m_grid.Populate(m_pOperator);
	
	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}


void COperatorDialog::SetOperator(ck::Operator* pOperator)
{
	m_pOperator = pOperator;
}